﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Linq;

public partial class Templates_Header : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataBind();
        }

    }

    public override void DataBind()
    {
        if (Page.CurrentTemplate != null)
        {
            tabs.Tabs.First().Text = string.Format("{0} Details", Page.CurrentTemplate.Name);
            foreach (Telerik.Web.UI.RadTab tab in tabs.Tabs)
            {
                tab.Enabled = true;
                tab.NavigateUrl = Page.AppendQueryString(tab.NavigateUrl);
            }
        }
        else
        {
            foreach (Telerik.Web.UI.RadTab tab in tabs.Tabs)
            {
                tab.Enabled = false;
            }
        }
    }

    public new BaseTemplatePage Page
    {
        get { return base.Page as BaseTemplatePage; }
    }

}
